<template>
  <router-view />
</template>

<script lang="ts" setup>
import axios from "axios"
import {onMounted} from "vue"
import {title} from '@/../package.json'
import {COMPILE_TIME_FILE_PATH} from "@/framework/utils/constant"
import {useCopyrightStore} from "@/framework/store/copyright/copyright";

const copyrightStore = useCopyrightStore()
onMounted( () => {
  const { MODE } = import.meta.env
  let env = ''
  if (MODE === 'development') env = '测试--'
  else if (MODE === 'pre') env = '预生产--'
  document.title = env + title
  axios.get(COMPILE_TIME_FILE_PATH)
    .then(res => console.log(res.data.time))
    .catch(() => console.log('尚未在项目路径中找到"compileTime.json"找到文件，无法打印编译时间'))
  copyrightStore.setCopyrightIcp('天津市南开区谭雅计算机技术中心', '津ICP备2024014265号-1')
})

</script>
